package com.boliq.lol.ui.fragment;

import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import androidx.core.view.GravityCompat;

import com.boliq.lol.R;
import com.boliq.lol.base.BaseFragment;
import com.boliq.lol.ui.MainActivity;
import com.boliq.lol.ui.activity.SettingActivity;

public class UserCenterFragment extends BaseFragment implements View.OnClickListener{

    ImageView img_drawer_btn;
    ImageView img_more_btn;
    TextView kapian;
    TextView zhanji;
    TextView tiezi;

    @Override
    protected int rootLayout() {
        return R.layout.fragment_user_center;
    }

    @Override
    protected void initView(View view) {
        RelativeLayout l=getActivity().findViewById(R.id.top);
        l.setVisibility(View.GONE);

        img_drawer_btn=view.findViewById(R.id.img_drawer_btn);
        img_drawer_btn.setOnClickListener(this);

        img_more_btn=view.findViewById(R.id.img_more_btn);
        img_more_btn.setOnClickListener(this);

        kapian=view.findViewById(R.id.kapian);
        kapian.setOnClickListener(this);

        zhanji=view.findViewById(R.id.zhanji);
        zhanji.setOnClickListener(this);

        tiezi=view.findViewById(R.id.tiezi);
        tiezi.setOnClickListener(this);

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void bindEvent() {

    }

    public void onClick(View view) {
        switch (view.getId()){
            case R.id.img_drawer_btn:
                //页面跳转
                Intent intent=new Intent(getActivity(),SettingActivity.class);
                //第一个参数是当前的上下文，如果是activity就写成改activity的名字.class,是Fragment就写成getActivity(),
//                第二个参数是要跳转的activity的名字.class
                startActivity(intent);
                Toast.makeText(getActivity(),"返回主界面",Toast.LENGTH_SHORT).show();
                break;
            case R.id.img_more_btn:
                Toast.makeText(getActivity(),"更多",Toast.LENGTH_SHORT).show();
                break;
            case R.id.kapian:
                Toast.makeText(getActivity(),"卡片管理",Toast.LENGTH_SHORT).show();
                break;
            case R.id.zhanji:
                Toast.makeText(getActivity(),"战绩",Toast.LENGTH_SHORT).show();
                break;
            case R.id.tiezi:
                Toast.makeText(getActivity(),"帖子",Toast.LENGTH_SHORT).show();
                break;

        }
    }

}
